<div ng-controller="shopDetailEditCtrl">
    <div class="bg-light lter b-b wrapper-md ng-scope">
        <h4 class="m-n font-thin">店铺管理</h4>
        <button onClick="javascript: history.go(-1);" class="btn-back btn btn-dark btn-sm btn-rounded">
            返回
        </button>
    </div>

    <div class="wrapper-md">
        <div class="panel">
            <div class="panel-body">
                <div class="shop_header_container">
                    <div class="shop_header_item shop_header_item_active">
                        <span class="shop_header_item_span">店铺基本信息</span>
                        <div class="tran-right"></div>
                    </div>
                    <div class="shop_header_item">
                        <div class="tran-left"></div>
                        <span class="shop_header_item_span">店铺营业执照信息</span>
                    </div>
                </div>
                <form class="form-horizontal form-validation">
                    <div>
                        <div class="padder-md padder-v bg-light m-b-sm">
                            <span class="font-bold">基本信息</span>
                            <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6" popover-placement="top" popover="门店的基本信息,包含名字地址等" popover-trigger="mouseenter"></i>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label font-bold">店铺头像</label>
                            <div class="col-md-10 bg-in">
                                <div>
                                    <uploadpic queue-limit="{{headerLimit}}" path="{{path}}" images="headerImages" app="app" queue="headerQueue" del-func="delShopHeaderImages"></uploadpic>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label font-bold">店铺名称</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control" ng-model="shop.name" placeholder="请输入店铺名称">
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label font-bold">店铺电话</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control" ng-model="shop.mobilePhone" placeholder="请输入店铺电话">
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label font-bold">营业日期</label>
                            <div class="col-sm-5">
                                <div class="inline pos-rlt m-r-xs" ng-class="{true:'week-select',false:''}[item.state]" ng-click="item.state=!item.state;" ng-repeat="item in weeks">
                                    <div class="week-border">{{item.name}}</div>
                                    <div class="select-bar"></div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label font-bold">营业时间</label>
                            <div class="col-sm-5">
                                <div class="inline m-r-xs">
                                    <select ng-model="shop.startTime" class="form-control w-sm inline h6" ng-options="item for item in times">
                                        <option value="">开始时间</option>
                                    </select>
                                    <p class="inline m-r-xs m-l-xs">至</p>
                                    <select ng-model="shop.endTime" class="form-control w-sm inline h6" ng-options="item for item in times">
                                        <option value="">结束时间</option>
                                    </select>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group" ng-show="shop.isMail==1">
                            <label class="col-sm-2 control-label font-bold">店铺背景图片</label>
                            <div class="col-md-10">
                                <div>
                                    <uploadpic queue-limit="{{backLimit}}" path="{{path}}" images="backImages" app="app" queue="backQueue" del-func="delBackgroundImage"></uploadpic>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group m-b-n block" ng-show="shop.isMail==1">
                            <label class="col-sm-2 control-label font-bold">店铺广告图</label>
                            <div class="col-md-10">
                                <div>
                                    <uploadpic queue-limit="{{bannerLimit}}" path="{{path}}"  images="bannerImages" app="app" queue="bannerQueue" del-func="delBannerImages"></uploadpic>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group wrapper bg-white ">
                            <label class="col-sm-2 control-label font-bold">营业状态</label>
                            <div class="row padder-md">
                                <ul class="pull-left nav nav-pills nav-sm" >
                                    <li>
                                        <div class="radio" ng-if="shop.auditStatus == 2">
                                            <label class="i-checks">
                                                <input type="radio" checked="shop.status==0" name="status" ng-model="shop.status" value="0" >
                                                <i></i>
                                                营业中
                                            </label>
                                        </div>
                                    </li>
                                    <li class="active">
                                        <div class="radio"  ng-if="shop.auditStatus == 2">
                                            <label class="i-checks">
                                                <input type="radio" checked="shop.status==1" name="status" ng-model="shop.status" value="1" >
                                                <i></i>
                                                休息中
                                            </label>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="radio" ng-if="shop.auditStatus != 0">
                                            <label class="i-checks">
                                                <input type="radio" checked="shop.status==2" name="status"  ng-model="shop.status" value="2">
                                                <i></i>
                                                停业整顿
                                            </label>
                                        </div>
                                    </li>

                                    <li>
                                        <label class="radio">
                                            <span class="label bg-danger" ng-if="shop.auditStatus == 0 ">等待审核中</span>
                                        </label>
                                    </li>
                                </ul>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label font-bold">归属地区</label>
                            <div class="col-sm-5">
                                <div class="w-full text-left">
                                    <div class="w-full btn-group dropdown m-b-sm">
                                        <div ng-click="findProvinces(0,0)" name="address" class="w-full text-left h6 form-control dropdown-toggle">{{selectProvice}}/{{selectTown}}/{{selectCounty}}</div>
                                    </div>
                                    <div ng-if="shopInfo.address.$touched">
                                        <label class="pull-left text-left text-danger h6 l-h"  ng-if="shopInfo.address.$error.required">请选择店铺归属地区</label>
                                    </div>
                                    <tabset class="tab-container register-address-container h6 bg-white" ng-show="showState">
                                        <tab heading="省" active="steps.step1">
                                            <div class="padder-md padder-v row" >
                                                <div class="col-md-3 m-b-xs text-center" ng-repeat="item in provinces">
                                                    <div class="btn btn-sm h6" ng-click="findTown(1,item)">{{item.name}}</div>
                                                </div>
                                            </div>
                                        </tab>
                                        <tab heading="市" active="steps.step2">
                                            <div class="padder-md padder-v row" >
                                                <div class="col-md-3 m-b-xs text-center" ng-repeat="item in towns">
                                                    <div class="btn btn-sm h6" ng-click="findCounty(2,item)">{{item.name}}</div>
                                                </div>
                                                <div class="panel-body h6" ng-if="towns.length<=0">
                                                    - 请先选择省级 -
                                                </div>
                                            </div>
                                        </tab>
                                        <tab heading="区" active="steps.step3">
                                            <div class="padder-md padder-v row" >
                                                <div class="col-md-3 m-b-xs text-center" ng-repeat="item in countys">
                                                    <div class="btn btn-sm h6" ng-click="CountyHide(item)">{{item.name}}</div>
                                                </div>
                                                <div class="panel-body h6" ng-if="countys.length<=0">
                                                    - 请先选择市级 -
                                                </div>
                                            </div>
                                        </tab>
                                    </tabset>

                                    <div>
                                        <span class="block text-danger h6" ng-if="!showState && currentState==1">*请先选择省</span>
                                        <span class="block text-danger h6" ng-if="!showState && currentState==2">*请先选择市</span>
                                        <span class="block text-danger h6" ng-if="!showState && currentState==3">*请先选择区</span>
                                    </div>

                                </div>


                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label font-bold">店铺详细地址</label>
                            <div class="col-sm-5">
                                <div class="input-group m-b-sm">
                                    <input type="text" class="form-control" ng-model="shop.address" placeholder="请输入店铺详细地址">
                                    <span class="btn btn-success input-group-addon icon-pointer" ng-click="site()"></span>
                                </div>
                                <div>
                                    <div class="m-b-sm h6" ng-if="addressState==1">
                                        <p class="block text-danger">*您提供的详细地址有多个坐标点,请手动拾取其中一个</p>
                                    </div>
                                    <div class="m-b-sm h6" ng-if="addressState==2">
                                        <p class="block text-danger">*您提供的详细地址未找到详细坐标点,请手动拾取坐标点</p>
                                    </div>
                                </div>
                                <div class="map-container pos-rlt">
                                    <div id="container"></div>
                                    <div id="panel"></div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label font-bold">店铺描述</label>
                            <div class="col-sm-4">
                                <textarea rows="6"  class="form-control h6" ng-model="shop.description" placeholder="请输入店铺简介"></textarea>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2" ng-if="!updateState">
                            <div class="inline m-r-xs">
                                <button type="submit" ng-if="!updateState" class="btn btn-success" ng-disabled="currentState!=4" ng-click="updateShop()">保存</button>
                                <button type="submit" ng-if="updateState" class="btn btn-success" disabled>保存中..</button>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
